<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
  Class: RubyMotionQuery::App
  
    &mdash; Documentation by YARD 0.8.7.3
  
</title>

  <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />

  <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  hasFrames = window.top.frames.main ? true : false;
  relpath = '../';
  framesUrl = "../frames.html#!" + escape(window.location.href);
</script>


  <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>

  <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>


  </head>
  <body>
    <div id="header">
      <div id="menu">
  
    <a href="../_index.html">Index (A)</a> &raquo;
    <span class='title'><span class='object_link'><a href="../RubyMotionQuery.html" title="RubyMotionQuery (module)">RubyMotionQuery</a></span></span>
     &raquo; 
    <span class="title">App</span>
  

  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  
    <a class="full_list_link" id="class_list_link"
        href="../class_list.html">
      Class List
    </a>
  
    <a class="full_list_link" id="method_list_link"
        href="../method_list.html">
      Method List
    </a>
  
    <a class="full_list_link" id="file_list_link"
        href="../file_list.html">
      File List
    </a>
  
</div>
      <div class="clear"></div>
    </div>

    <iframe id="search_frame"></iframe>

    <div id="content"><h1>Class: RubyMotionQuery::App
  
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName"><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></span>
      
        <ul class="fullTree">
          <li><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></li>
          
            <li class="next">RubyMotionQuery::App</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
  
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">motion/ruby_motion_query/app.rb</dd>
  
</dl>
<div class="clear"></div>








  
    <h2>
      Class Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#current_view_controller-class_method" title="current_view_controller (class method)">+ (UIViewController) <strong>current_view_controller</strong>(root_view_controller = nil) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Returns the current view controller in the app.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#delegate-class_method" title="delegate (class method)">+ (UIApplicationDelegate) <strong>delegate</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#development%3F-class_method" title="development? (class method)">+ (Boolean) <strong>development?</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>True if the app is running in the :development environment.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#document_path-class_method" title="document_path (class method)">+ (String) <strong>document_path</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Full path of the document folder.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#environment-class_method" title="environment (class method)">+ (Symbol) <strong>environment</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Environment the app is running it.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#identifier-class_method" title="identifier (class method)">+ (String) <strong>identifier</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Identifier of app.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#name-class_method" title="name (class method)">+ (String) <strong>name</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Name of app.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#release%3F-class_method" title="release? (class method)">+ (Boolean) <strong>release?</strong> </a>
    

    
      (also: production?)
    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>True if the app is running in the :release environment.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#resource_path-class_method" title="resource_path (class method)">+ (String) <strong>resource_path</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Full path of the resources folder.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#test%3F-class_method" title="test? (class method)">+ (Boolean) <strong>test?</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>True if the app is running in the :test environment.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#version-class_method" title="version (class method)">+ (String) <strong>version</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Version.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#window-class_method" title="window (class method)">+ (UIWindow) <strong>window</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
    </ul>
  



  <div id="class_method_details" class="method_details_list">
    <h2>Class Method Details</h2>

    
      <div class="method_details first">
  <h3 class="signature first" id="current_view_controller-class_method">
  
    + (<tt><span class='object_link'><a href="../UIViewController.html" title="UIViewController (class)">UIViewController</a></span></tt>) <strong>current_view_controller</strong>(root_view_controller = nil) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns the current view controller in the app. If the current controller
is a tab or navigation controller, then it gets the current tab or topmost
controller in the nav.</p>

<p>This mostly works... mostly. As there really isn't a "current
view_controller"</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="../UIViewController.html" title="UIViewController (class)">UIViewController</a></span></tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


79
80
81
82
83
84
85
86
87
88
89
90</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/app.rb', line 79</span>

<span class='kw'>def</span> <span class='id identifier rubyid_current_view_controller'>current_view_controller</span><span class='lparen'>(</span><span class='id identifier rubyid_root_view_controller'>root_view_controller</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
  <span class='kw'>if</span> <span class='id identifier rubyid_root_view_controller'>root_view_controller</span> <span class='op'>||</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_window'>window</span> <span class='op'>=</span> <span class='const'>RMQ</span><span class='period'>.</span><span class='id identifier rubyid_app'>app</span><span class='period'>.</span><span class='id identifier rubyid_window'>window</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='lparen'>(</span><span class='id identifier rubyid_root_view_controller'>root_view_controller</span> <span class='op'>=</span> <span class='id identifier rubyid_window'>window</span><span class='period'>.</span><span class='id identifier rubyid_rootViewController'>rootViewController</span><span class='rparen'>)</span><span class='rparen'>)</span>
    <span class='kw'>case</span> <span class='id identifier rubyid_root_view_controller'>root_view_controller</span>
    <span class='kw'>when</span> <span class='const'>UINavigationController</span>
      <span class='id identifier rubyid_root_view_controller'>root_view_controller</span><span class='period'>.</span><span class='id identifier rubyid_visibleViewController'>visibleViewController</span>
    <span class='kw'>when</span> <span class='const'>UITabBarController</span>
      <span class='id identifier rubyid_current_view_controller'>current_view_controller</span><span class='lparen'>(</span><span class='id identifier rubyid_root_view_controller'>root_view_controller</span><span class='period'>.</span><span class='id identifier rubyid_selectedViewController'>selectedViewController</span><span class='rparen'>)</span>
    <span class='kw'>else</span> 
      <span class='id identifier rubyid_root_view_controller'>root_view_controller</span>
    <span class='kw'>end</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="delegate-class_method">
  
    + (<tt>UIApplicationDelegate</tt>) <strong>delegate</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>UIApplicationDelegate</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


23
24
25</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/app.rb', line 23</span>

<span class='kw'>def</span> <span class='id identifier rubyid_delegate'>delegate</span> 
  <span class='const'>UIApplication</span><span class='period'>.</span><span class='id identifier rubyid_sharedApplication'>sharedApplication</span><span class='period'>.</span><span class='id identifier rubyid_delegate'>delegate</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="development?-class_method">
  
    + (<tt>Boolean</tt>) <strong>development?</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns true if the app is running in the :development environment</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>true if the app is running in the :development environment</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


44
45
46</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/app.rb', line 44</span>

<span class='kw'>def</span> <span class='id identifier rubyid_development?'>development?</span>
  <span class='id identifier rubyid_environment'>environment</span> <span class='op'>==</span> <span class='symbol'>:development</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="document_path-class_method">
  
    + (<tt>String</tt>) <strong>document_path</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns Full path of the document folder</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>Full path of the document folder</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


69
70
71</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/app.rb', line 69</span>

<span class='kw'>def</span> <span class='id identifier rubyid_document_path'>document_path</span>
  <span class='const'>NSSearchPathForDirectoriesInDomains</span><span class='lparen'>(</span><span class='const'>NSDocumentDirectory</span><span class='comma'>,</span> <span class='const'>NSUserDomainMask</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="environment-class_method">
  
    + (<tt>Symbol</tt>) <strong>environment</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns Environment the app is running it</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Symbol</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>Environment the app is running it</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


28
29
30</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/app.rb', line 28</span>

<span class='kw'>def</span> <span class='id identifier rubyid_environment'>environment</span>
  <span class='const'>RUBYMOTION_ENV</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="identifier-class_method">
  
    + (<tt>String</tt>) <strong>identifier</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns Identifier of app</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>Identifier of app</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


59
60
61</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/app.rb', line 59</span>

<span class='kw'>def</span> <span class='id identifier rubyid_identifier'>identifier</span>
  <span class='const'>NSBundle</span><span class='period'>.</span><span class='id identifier rubyid_mainBundle'>mainBundle</span><span class='period'>.</span><span class='id identifier rubyid_bundleIdentifier'>bundleIdentifier</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="name-class_method">
  
    + (<tt>String</tt>) <strong>name</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns Name of app</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>Name of app</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


54
55
56</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/app.rb', line 54</span>

<span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
  <span class='const'>NSBundle</span><span class='period'>.</span><span class='id identifier rubyid_mainBundle'>mainBundle</span><span class='period'>.</span><span class='id identifier rubyid_objectForInfoDictionaryKey'>objectForInfoDictionaryKey</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>CFBundleDisplayName</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="release?-class_method">
  
    + (<tt>Boolean</tt>) <strong>release?</strong> 
  

  
    <span class="aliases">Also known as:
    <span class="names"><span id='production?-class_method'>production?</span></span>
    </span>
  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns true if the app is running in the :release environment</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>true if the app is running in the :release environment</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


33
34
35</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/app.rb', line 33</span>

<span class='kw'>def</span> <span class='id identifier rubyid_release?'>release?</span>
  <span class='id identifier rubyid_environment'>environment</span> <span class='op'>==</span> <span class='symbol'>:release</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="resource_path-class_method">
  
    + (<tt>String</tt>) <strong>resource_path</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns Full path of the resources folder</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>Full path of the resources folder</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


64
65
66</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/app.rb', line 64</span>

<span class='kw'>def</span> <span class='id identifier rubyid_resource_path'>resource_path</span>
  <span class='const'>NSBundle</span><span class='period'>.</span><span class='id identifier rubyid_mainBundle'>mainBundle</span><span class='period'>.</span><span class='id identifier rubyid_resourcePath'>resourcePath</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="test?-class_method">
  
    + (<tt>Boolean</tt>) <strong>test?</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns true if the app is running in the :test environment</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>true if the app is running in the :test environment</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


39
40
41</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/app.rb', line 39</span>

<span class='kw'>def</span> <span class='id identifier rubyid_test?'>test?</span>
  <span class='id identifier rubyid_environment'>environment</span> <span class='op'>==</span> <span class='symbol'>:test</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="version-class_method">
  
    + (<tt>String</tt>) <strong>version</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns Version</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>Version</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


49
50
51</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/app.rb', line 49</span>

<span class='kw'>def</span> <span class='id identifier rubyid_version'>version</span>
  <span class='const'>NSBundle</span><span class='period'>.</span><span class='id identifier rubyid_mainBundle'>mainBundle</span><span class='period'>.</span><span class='id identifier rubyid_infoDictionary'>infoDictionary</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>CFBundleVersion</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="window-class_method">
  
    + (<tt>UIWindow</tt>) <strong>window</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>UIWindow</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


18
19
20</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/app.rb', line 18</span>

<span class='kw'>def</span> <span class='id identifier rubyid_window'>window</span>
  <span class='const'>UIApplication</span><span class='period'>.</span><span class='id identifier rubyid_sharedApplication'>sharedApplication</span><span class='period'>.</span><span class='id identifier rubyid_keyWindow'>keyWindow</span> <span class='op'>||</span> <span class='const'>UIApplication</span><span class='period'>.</span><span class='id identifier rubyid_sharedApplication'>sharedApplication</span><span class='period'>.</span><span class='id identifier rubyid_windows'>windows</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>

    <div id="footer">
  Generated on Sun Dec  8 20:15:51 2013 by
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.8.7.3 (ruby-1.9.3).
</div>

  </body>
</html>